import Main from '@/components/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 * keepAlive: true,
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

import businessSectorRouter from './modules/business-sector.js'
import hrdcSalesCenterRouter from './modules/hrdc-sales-center.js'
import hrdcDeliverCenterRouter from './modules/hrdc-deliver-center.js'
import financeRouter from './modules/finance.js'
import reportManageRouter from './modules/report-manage.js'
import policySupportRouter from './modules/policy-support.js'
import riskMonitorRouter from './modules/risk-monitor.js'
import commerceContractRouter from './modules/commerce-contract.js'
import docManageRouter from './modules/doc-manage.js'
import systemMangeRouter from './modules/system-mange.js'
import thirdPartyPlatformRouter from './modules/third-party-platform.js'
import mailManageRouter from './modules/mail-manage.js'
import processCenterRouter from './modules/process-center.js'

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      keepAlive: true,
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  {
    path: '/third_party_login',
    name: 'third_party_login',
    meta: {
      keepAlive: true,
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/third_party_login.vue')
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    component: Main,
    meta: {
      keepAlive: true,
      title: '工作台',
      access: ['_home']
      // notCache: false
    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          keepAlive: true,
          // hideInMenu: true,
          title: '工作台',
          // notCache: false,
          access: ['_home'],
          icon: '_gongzuotai'
        },
        component: () => import('@/view/home/home.vue')
      }
    ]
  },
  processCenterRouter, // 流程管理
  {
    path: '/dailyManage',
    name: 'dailyManage',
    meta: {
      keepAlive: true,
      icon: '_richangguanli',
      showAlways: true,
      access: ['dailymag'],
      title: '日常管理'
    },
    component: Main,
    children: [
      {
        path: 'workPlan',
        name: 'workPlan',
        meta: {
          keepAlive: true,
          access: ['WorkDayPlan'],
          title: '工作计划'
        },
        component: () => import('@/view/oti-center/dailyManage/workPlan.vue')
      },
      {
        path: 'work-schedule',
        name: 'work-schedule',
        meta: {
          keepAlive: true,
          access: ['WorkPlanComplete'],
          title: '工作计划'
        },
        component: () => import('@/view/oti-center/dailyManage/work-schedule/index.vue')
      }
    ]
  },
  {
    path: '/data-screening',
    name: 'data-screening',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/data-screening/index.vue')
  },
  {
    path: '/data-screening-once',
    name: 'data-screening-once',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/data-screening/index-once.vue')
  },
  {
    path: '/error_message',
    name: 'error_message',
    meta: {
      keepAlive: true,
      hideInMenu: true
    },
    component: () => import('@/view/error-page/error_message.vue')
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      keepAlive: true,
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      keepAlive: true,
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      keepAlive: true,
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  },
  {
    path: '/message',
    name: 'message',
    component: Main,
    meta: {
      keepAlive: true,
      hideInBread: true,
      hideInMenu: true
    },
    children: [
      {
        path: 'message_page',
        name: 'message_page',
        meta: {
          keepAlive: true,
          icon: 'md-notifications',
          title: '消息中心'
        },
        component: () => import('@/view/single-page/message/index.vue')
      }
    ]
  },
  {
    path: '/revise',
    name: 'revise',
    component: Main,
    meta: {
      keepAlive: true,
      hideInBread: true,
      hideInMenu: true
      // notCache: false
    },
    children: [
      {
        path: 'password',
        name: 'password',
        meta: {
          keepAlive: true,
          title: '修改密码',
          // notCache: false,
          icon: ''
        },
        component: () => import('@/view/login/revisepw.vue')
      }
    ]
  },
  {
    path: '/logger',
    name: 'logger',
    component: Main,
    meta: {
      keepAlive: true,
      hideInBread: true,
      hideInMenu: true
      // notCache: false
    },
    children: [
      {
        path: 'loggerList',
        name: 'loggerList',
        meta: {
          keepAlive: true,
          title: '操作日志',
          // notCache: false,
          icon: ''
        },
        component: () => import('@/view/home/logger.vue')
      }
    ]
  },
  mailManageRouter, // 邮件管理
  businessSectorRouter, // 一体化灵活用工
  hrdcSalesCenterRouter, // hrdc销售中心
  hrdcDeliverCenterRouter, // HRDC交付中心
  financeRouter, // 财务
  reportManageRouter,// 报表管理
  // {
  //   path: '/report-manage',
  //   name: 'report-manage',
  //   component: Main,
  //   meta: {
  //     keepAlive: false,
  //     hideInMenu: false,
  //     access: ['report'],
  //     title: '报表管理',
  //     icon: '_baobiaoguanli',
  //     notCache: true
  //   },
  //   component: () => import('@/view/data-screening/index.vue')
  // },
  policySupportRouter,  // 政策管理
  riskMonitorRouter, // 风险监控
  commerceContractRouter, // 商务合同管理
  {
    path: '/enterpriseCertificateManage',
    name: 'enterpriseCertificateManage',
    meta: {
      keepAlive: true,
      icon: '_shangwuhetongguanli',
      title: '公司证照管理',
      // showAlways: true,
      access: ['BusinessDocument']
    },
    component: Main,
    children: [
      {
        path: 'enterpriseCertificateManageList',
        name: 'enterpriseCertificateManageList',
        meta: {
          keepAlive: true,
          icon: '_shangwuhetongguanli',
          title: '公司证照管理',
          access: ['BusinessDocument'],
          isWarn: true
        },
        component: () => import('@/view/enterprise-certificate-manage/enterpriseCertificateManage.vue')
      }
    ]
  },
  docManageRouter, // 档案管理
  systemMangeRouter,  // 系统管理
  thirdPartyPlatformRouter, // 第三方接口平台
  {
    path: '/upgradeNotice',
    name: 'upgradeNotice',
    component: Main,
    meta: {
      keepAlive: true,
      hideInMenu: false,
      title: '升级公告',
      access: ['UpBulletin'],
      // notCache: false,
      icon: '_shengjigonggao'
    },
    children: [
      {
        path: 'upgradeNoticeList',
        name: 'upgradeNoticeList',
        meta: {
          keepAlive: true,
          hideInMenu: false,
          title: '升级公告',
          access: ['UpBulletin'],
          // notCache: false,
          icon: '_shengjigonggao'
        },
        component: () => import('@/view/upgrade-notice/upgradeNotice.vue')
      }
    ]
  },
  
]
